package com.blog.service;

import com.blog.mapper.ProductSpuMapper;
import com.blog.seckill.goods.Good;
import com.blog.seckill.goods.ProductSpu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName ProductSpuBaseService
 * @Destription ProductSpu基础：增删改查
 * @Author 天堂小野花
 * @Date 2025/8/19  18:24
 * @Version 1.0
 */
@Service
public class ProductSpuBaseService {
    @Autowired
    ProductSpuMapper productSpuMapper;

    //表   ProductSpu
    public ProductSpu selectProductSpuById(Long id){
        return productSpuMapper.selectByPrimaryKey(id);
    }
    public int insertProductSpu(ProductSpu productSpu){
        return productSpuMapper.insert(productSpu);
    }
    public int updateProductSpu(ProductSpu productSpu){
        return productSpuMapper.updateByPrimaryKeySelective(productSpu);
    }
    public int deleteProductSpuById(Long id){
        return productSpuMapper.deleteByPrimaryKey(id);
    }

    public List<Good> selectAllGoods() {
        return productSpuMapper.selectAllGoods();
    }


}
